<head>
@extends('layouts.admin_common')
@section('content')
<!-- SSLの場合 -->
@if(app('env')=='production')
<link rel="stylesheet" href="{{ secure_asset('/css/sale.css') }}">
<script src="{{ secure_asset('/js/sale.js') }}"></script>
@else
<!-- SSLではない場合 -->
<link rel="stylesheet" href="{{ asset('/css/sale.css') }}">
<script src="{{ asset('/js/sale.js') }}"></script>
@endif
</head>



<div class="breadcrumbs_container">
    {{Breadcrumbs::render('admin.sale_master') }}
</div>
<div class="system_tab_line"></div>

<div id="outDiv">
<form class="pure-form pure-form-stacked" method="POST" id="saleForm" enctype="multipart/form-data">
			<table class="table table-condensed">

				<tr>
					<td>セール名称</td>
					<td>商品コード</td>
					<td>商品名</td>
					<td>対象商品</td>
					<td>適用対象 </td>
					<td></td>
				</tr>
				<tr>
				@foreach ($allSale as $allSaleInfo)
				<tr>
					<td>{{$allSaleInfo->sale_name}}</td>
					<td>{{$allSaleInfo->goods_code}}</td>
					<td>{{$allSaleInfo->goods_name}}</td>
					<td>{{$allSaleInfo->corp_name}}</td>
					<td>{{$allSaleInfo->category_name}}</td>
					<td><input type="button" value="修正"
						class="btn btn-primary button_normal"
						onclick="onSubmitUpdate('update','{{$allSaleInfo->sale_id}}')"/>
						<input type="button" value="削除" class="btn btn-primary button_normal"
						onclick="onSubmitDel('delete','{{$allSaleInfo->sale_id}}')"/></td>
				</tr>
				@endforeach
			</table>

			<table border="0" cellspacing="0" style="width: 1300px;">
				<tr>
					<td align="right" style="width: 1100px;"><input type="button" value="@lang('messages.addSale')"
						class="pure-button pure-button-primary button_normal"
						onclick="addSale()"/></td>
					<td align="right" style="width: 30px;"><input type="button" value="@lang('messages.cancel')"
						class="pure-button pure-button-primary button_normal"
						onclick="cancelSale()" /></td>
                </tr>
			</table>
			<input type="hidden" id="sale_id" name="sale_id">
			<input type="hidden" name="_token" value="{{csrf_token()}}">
			<div>@if(isset($success)) {{$success}} @endif</div>
			<div>@if(isset($error)) {{$error}} @endif</div>


</form>

</div>
@endsection
